package hd.util.file;


/**
 * 文件下载
 * <p/>
 * Created by haidy on 14/11/21.
 */
public abstract class OnFileDownload {

    private FileInfo fileInfo;

    /**
     * 下载文件信息
     *
     * @param fileInfo 文件信息
     */
    public abstract void onLoadFileInfo(FileInfo fileInfo);

    /**
     * 设置文件信息
     *
     * @param fileInfo fileInfo
     */
    public void setFileInfo(FileInfo fileInfo) {
        this.fileInfo = fileInfo;
    }

    public abstract void onDownloading(long size);

    /**
     * 下载
     */
    public void download(String filePath, String fileName) {
        FileDownload.fileDownload(fileInfo, filePath, fileName, this);
    }
}